package ch10.test;

import java.sql.SQLClientInfoException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import javax.naming.NameAlreadyBoundException;

import ch10.Computer;

public class SetClass {

	public static void main(String[] args) {
		
		Student student = new Student(1,"ewe");
		Student student2 = new Student(2,"hhl");
		Student student3 = new Student(3,"hxl");
		
		Set studetSet = new HashSet();
		
		studetSet.add(student);
		studetSet.add(student2);
		studetSet.add(student3);
		Iterator iterator = studetSet.iterator();
		while (iterator.hasNext()) {
		  Object object = iterator.next();
		  Student stu = (Student)object;
			System.out.println(stu.toString());
		}

	}

}
